package org.apache.hadoop.contrib.mfs;

import java.util.List;

public class FileInfo {

	private String path;
	private String fileName;
	private List<Chunk> chunkList;
	private long size;
	private long timestamp;

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFileName() {
		return fileName;
	}

	public void setChunkList(List<Chunk> chunkList) {
		this.chunkList = chunkList;
	}

	public List<Chunk> getChunkList() {
		return chunkList;
	}

	public void setSize(long size) {
		this.size = size;
	}

	public long getSize() {
		return size;
	}

        public void updateTimestamp() {
            this.setTimestamp(System.currentTimeMillis());
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setPath(String path) {
            if(path.endsWith("/")){
                path = path.substring(0, path.length()-1);
            }
            this.path = path;
	}

        public String getPath() {
            return path;
        }

	public String getAbsolutePath() {
		return path + "/" + fileName;
	}
}